package cn.tdu.common.feign;

import cn.tdu.common.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("micro-service-stock")
public interface StockClient {
    @GetMapping("/stock/check")
    Integer checkStock(@RequestParam("productCode") String productCode);

    @PostMapping("/stock/reduce")
    JsonResult reduceStock(@RequestParam("productCode") String productCode,
                           @RequestParam("count") Integer count);
}
